import Home from '@/views/Home'
const Category = () => import('@/views/Category')
const Cart = () => import('@/views/Cart')
const User = () => import('@/views/User')
const Item = () => import('@/views/Item')
const List = () => import('@/views/List')
const PageFooter = () => import('@/components/PageFooter')
const PageHeader = () => import('@/components/PageHeader')
const Login = () => import('@/views/Login')
const Register = () => import('@/views/Register')
const Search = () => import('@/views/Search')

export default [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'home',
        components: {
            default: Home,
            pageFooter: PageFooter
        },
        meta: {
            title: '首页',
            index: 0
        }
    },
    {
        path: '/category',
        name: 'category',
        components: {
            default: Category,
            pageFooter: PageFooter
        },
        meta: {
            title: '分类',
            index: 1
        }
    },
    {
        path: '/cart',
        name: 'cart',
        components: {
            default: Cart,
            pageFooter: PageFooter
        },
        meta: {
            title: '购物车',
            needHeaderLeft: false,
            needHeaderRight: true,
            index: 2
        }
    },
    {
        path: '/user',
        name: 'user',
        components: {
            default: User,
            pageFooter: PageFooter
        },
        meta: {
            title: '个人中心',
            needHeaderLeft: false,
            needHeaderRight: false,
            index: 3
        }
    },
    {
        path: '/list',
        name: 'list',
        component: List,
        meta: {
            title: '商品列表',
            needHeaderLeft: true,
            needHeaderRight: false
        }
    },
    {
        path: '/item',
        name: 'item',
        component: Item,
        meta: {
            title: '商品详情',
            needHeaderLeft: true,
            needHeaderRight: false
        }
    },
    {
        path: '/login',
        name: 'login',
        component: Login,
        meta: {
            title: '账号密码登录'
        }
    },
    {
        path: '/register',
        name: 'register',
        components: {
            header: PageHeader,
            default: Register
        },
        meta: {
            title: '注册'
        }
    },
    {
        path: '/search',
        name: 'search',
        components: {
            default: Search
        },
        meta: {
            title: '搜索页'
        }
    }
]
